home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / GTDFLTPL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  596 b   |  19 lines

  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <graphics.h>
  4. main()
  5. {
  6.    int graphdriver=DETECT, graphmode, numcolors;
  7.    struct palettetype *p_pal;
  8. /* Detect and initialize the graphics system */
  9.    initgraph(&graphdriver, &graphmode, "c:\\turboc");
  10. /* Display the default palette of the current graphics driver */
  11.    p_pal = getdefaultpalette();
  12.    numcolors = p_pal->size;
  13.    printf("The %s driver's default palette in %s mode has %d colors \n",
  14.    getdrivername(), getmodename(graphmode), numcolors);
  15.  
  16. /* Wait for a keystroke before exiting */
  17.    getch();
  18.    closegraph();
  19. }